package com.cxy.petworldapp

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // 启用边缘到边缘显示
        enableEdgeToEdge()

        // 设置内容视图
        setContentView(R.layout.activity_main)

        // 处理窗口插入以实现适当的填充
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { view, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            view.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        // 设置导航监听器
//        setupNavigation()
    }

//    private fun setupNavigation() {
//        // 查找宠物商城快速操作按钮
//        val petMallQuickAction = findViewById<View>(R.id.pet_mall_quick_action)
//        petMallQuickAction?.setOnClickListener {
//            navigateToPetMall()
//        }
//
//        // 查找底部导航宠物商城项
//        val petMallNavItem = findViewById<View>(R.id.nav_mall_item)
//        petMallNavItem?.setOnClickListener {
//            navigateToPetMall()
//        }
//    }

//    private fun navigateToPetMall() {
//        val intent = Intent(this, PetMallActivity::class.java)
//        startActivity(intent)
//    }
}